# -*- coding: utf-8 -*-
from sqlalchemy import Column, Integer, BigInteger, String, DateTime, Text

from core.database import Base
from core.database import TimestampMixin

class TbTopic(Base, TimestampMixin):
    __tablename__ = 'tb_topic'

    id = Column(BigInteger, primary_key=True, comment ='主键')
    title =  Column(String(128), comment ='标题')
    content =  Column(Text, comment ='内容')
    category =  Column(Integer, comment ='分类')
    status =  Column(Integer, comment ='状态')
    

class TbTag(Base, TimestampMixin):
    __tablename__ = 'tb_tag'

    id = Column(BigInteger, primary_key=True, comment ='主键id')
    name =  Column(String(128), comment ='标签名称')

class TbAttachment(Base, TimestampMixin):
    __tablename__ = 'tb_attachment'

    id = Column(BigInteger, primary_key=True, comment ='主键id')
    name =  Column(String(128), comment ='附件名称')
    category =  Column(String(128), comment ='附件分类') # 0: image, 1: video, 2: audio, 3: file
    content_type =  Column(String(128), comment ='附件类型') # image/jpeg, video/mp4, audio/mpeg, application/pdf
    status =  Column(Integer, default=0, comment ='附件状态') # 0: created, 1: uploading, 2: success, 3: failed, 
    url =  Column(String(256), comment ='附件url')
    hash =  Column(String(128), comment ='附件hash')
    size =  Column(Integer, comment ='附件大小')
